<template>
  <SearchPannelMaxin
    v-model= "element"
    :setsearchcondition= "setcondition"
  >
  </SearchPannelMaxin>
</template>
<script>
  import SearchPannelMaxin from '@/components/SearchPannelMaxin'
  import { fetchListRecommend,deleteRecommend } from '@/api/recommend'
  export default {
    components: {
      SearchPannelMaxin
    },
    data() {
      return {
        element: {
          // 设置普通查询区域
          searchOperation: {
            searchResult: '',
            r: fetchListRecommend,
            aftersearch: this.aftersearch,
          },
          // 设置高级查询区域
          searchPlusOperation: {
            // 是否显示高级搜索
            isShow: false
          },
          // 按钮区域的设置
          btnOperation: {
            // 显示创建按钮 （默认不显示）
            showcreate: true,
            // 显示批量删除按钮（默认不显示）
            showBatchDelete: true,
            // 创建对话框的设置
            createdialogoption: {
              // 设置样式类
              class: '',
              // 设置宽度
              width: '60%',
              vueName: 'recommend',
              src: 'recommend/components/createOrUpdate'
            },
            customerBtns: [],
            /* 设置自定义按钮
            customerBtns: [{
              name: '新  建',
              code: 'create',
            },{
              name: '批量删除',
              code: 'batchDel',
            }]*/
          },
          // 表格显示区域的设置
          gridOperation: {
            normalitems: [
              {
                prop: 'Id',
                label: '主键',
                width: '60'
              },
              {
                prop: 'Supplier_pid',
                label: '供应商表主键',
                width: '180'
              },
              {
                prop: 'Supplier_name',
                label: '供应商名称',
                width: '150'
              },
              {
                prop: 'Supplier_connecter',
                label: '供应商联系人',
                width: '180'
              },
              {
                prop: 'Supplier_position',
                label: '供应商联系人职位',
                width: '240'
              },
              {
                prop: 'Supplier_phone',
                label: '供应商联系人电话',
                width: '240'
              },
              {
                prop: 'Supplier_mail',
                label: '供应商联系人邮箱',
                width: '240'
              },
              {
                prop: 'Recommand_code',
                label: '供应商推荐识别码',
                width: '240'
              },
              {
                prop: 'Recommand_reason',
                label: '推荐原因',
                width: '120'
              },
              {
                prop: 'Supplier_type',
                label: '推荐供应商类型',
                width: '210'
              },
              {
                prop: 'Recommand_dept',
                label: '推荐部门',
                width: '120'
              },
              {
                prop: 'Recommander',
                label: '推荐人',
                width: '90'
              },
              {
                prop: 'Supplier',
                label: '采购部负责人',
                width: '180'
              },
              {
                prop: 'Updatedate',
                label: 'undefined',
                width: '90'
              },
              {
                prop: 'Updater',
                label: 'undefined',
                width: '90'
              },
              {
                prop: 'Createdate',
                label: 'undefined',
                width: '90'
              },
              {
                prop: 'Creater',
                label: 'undefined',
                width: '90'
              },
              {
                prop: 'Isdeleted',
                label: 'undefined',
                width: '90'
              },
            ],
            operationitem:[],
            datalist: []
          }
        }
      }
    },
    methods: {
      // 设置查询条件
      setcondition(value) {
        return value
      },
      // 查询后 显示结果前的回调函数
      aftersearch(data) {
        return data
      }
    }
  }
</script>
